package com.wander.patterns.act.observer2;

/**
 * @description:使用JDK 提供类(Observable Observer接口)实现
 * servlet 监听器 观察者机制
 * @author: zhuyong
 * @create: 2019-09-11 17:26
 **/
public class Client {
    public static void main(String[] args) {
        //即将广播的主题对象
        ConcreteSubject concreteSubject = new ConcreteSubject();
        ObserverA observerA = new ObserverA();

        //我observerA要订阅 这个concreteSubject
        concreteSubject.addObserver(observerA);



        concreteSubject.setStatus(2000);

        System.out.println(observerA.getStatus());
    }
}
